// 用于开发测试的模拟数据
import { Host, LoginRecord, DashboardStats } from '../types';

export const mockHosts: Host[] = [
  {
    id: '1',
    name: '生产服务器-Web01',
    ip: '192.168.1.101',
    port: 22,
    username: 'root',
    status: 'online',
    os: 'Ubuntu 22.04 LTS',
    cpu: 'Intel Xeon 8核',
    memory: '32GB',
    tags: ['生产环境', 'Web服务器'],
    description: '主要的Web应用服务器',
    lastLoginTime: '2025-10-11 09:30:00',
    loginCount: 156,
    deviceType: 'linux',
    protocol: 'ssh',
    createdAt: '2025-01-15 10:00:00',
    updatedAt: '2025-10-11 09:30:00',
  },
  {
    id: '2',
    name: '数据库服务器-MySQL',
    ip: '192.168.1.102',
    port: 22,
    username: 'admin',
    status: 'online',
    os: 'CentOS 7.9',
    cpu: 'AMD EPYC 16核',
    memory: '64GB',
    tags: ['生产环境', '数据库'],
    description: 'MySQL主数据库',
    lastLoginTime: '2025-10-10 15:20:00',
    loginCount: 89,
    deviceType: 'linux',
    protocol: 'ssh',
    createdAt: '2025-01-20 14:00:00',
    updatedAt: '2025-10-10 15:20:00',
  },
  {
    id: '3',
    name: 'Windows服务器-AD01',
    ip: '192.168.2.101',
    port: 3389,
    username: 'administrator',
    status: 'online',
    os: 'Windows Server 2019',
    cpu: 'Intel Core i7 4核',
    memory: '16GB',
    tags: ['生产环境', 'AD域控'],
    description: 'Active Directory 域控制器',
    lastLoginTime: '2025-10-11 08:15:00',
    loginCount: 234,
    deviceType: 'windows',
    protocol: 'rdp',
    createdAt: '2025-02-01 09:00:00',
    updatedAt: '2025-10-11 08:15:00',
  },
  {
    id: '4',
    name: '核心交换机-SW01',
    ip: '192.168.1.254',
    port: 22,
    username: 'admin',
    status: 'online',
    os: 'Cisco IOS 15.2',
    cpu: 'N/A',
    memory: '4GB',
    tags: ['网络设备', '核心交换机'],
    description: '数据中心核心交换机',
    lastLoginTime: '2025-10-09 16:45:00',
    loginCount: 45,
    deviceType: 'switch',
    protocol: 'ssh',
    createdAt: '2025-03-10 11:00:00',
    updatedAt: '2025-10-09 16:45:00',
  },
  {
    id: '5',
    name: 'Docker容器主机',
    ip: '192.168.3.101',
    port: 22,
    username: 'docker',
    status: 'online',
    os: 'Ubuntu 22.04 LTS',
    cpu: 'Intel Core i5 4核',
    memory: '8GB',
    tags: ['容器', 'Docker'],
    description: 'Docker 容器运行环境',
    lastLoginTime: '2025-10-05 18:00:00',
    loginCount: 412,
    deviceType: 'docker',
    protocol: 'ssh',
    createdAt: '2025-01-10 08:00:00',
    updatedAt: '2025-10-05 18:00:00',
  },
];

export const mockLoginRecords: LoginRecord[] = [
  {
    id: '1',
    hostId: '1',
    hostName: '生产服务器-Web01',
    hostIp: '192.168.1.101',
    username: 'root',
    loginTime: '2025-10-11 09:30:00',
    status: 'active',
  },
  {
    id: '2',
    hostId: '3',
    hostName: '测试环境-App01',
    hostIp: '192.168.2.101',
    username: 'test',
    loginTime: '2025-10-11 08:15:00',
    duration: 3900,
    status: 'completed',
  },
  {
    id: '3',
    hostId: '2',
    hostName: '数据库服务器-MySQL',
    hostIp: '192.168.1.102',
    username: 'admin',
    loginTime: '2025-10-10 15:20:00',
    duration: 4200,
    status: 'completed',
  },
];

export const mockDashboardStats: DashboardStats = {
  totalHosts: 5,
  onlineHosts: 4,
  offlineHosts: 1,
  recentLogins: 3,
};

// 模拟 API（用于开发阶段）
//  已废弃：现在统一使用真实后端API，不再使用mock数据
export const useMockData = false; // 设置为 false 时使用真实 API

